<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo">
<head>
    <block>
        <title>代码生成器</title>
    </block>

    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="description" content=""/>
    <meta name="keywords" content=""/>
    <link rel="stylesheet" th:href="@{/lib/layui-v2.3.0/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/css/main.css}" media="all">
    <link rel="stylesheet" th:href="@{/css/generate.code.css}">
    <link rel="stylesheet" th:href="@{/lib/formSelects-v4/formSelects-v4.css}">
    <link rel="stylesheet" th:href="@{/lib/zTree_v3/css/zTreeStyle/zTreeStyle.css}" type="text/css">
</head>
<body class="timo-layout-page">
<div class="layui-card" style="padding: 30px 15px;">
    <div class="layui-card-header timo-card-header">
        <span><i class="fa fa-bars"></i> 代码生成</span>
    </div>
    <div class="layui-card-body">
        <form class="layui-form" lay-filter="infoForm" id="infoForm">
        <fieldset id="basic" class="layui-elem-field layui-form">
            <legend class="code-legend">基本信息</legend>
            <div class="layui-field-box">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">生成表</label>
                        <div class="layui-input-inline">
                            <select lay-filter="select_tables" lay-search name="table">
                                <option value="">请选择</option>
                                <option th:each="item : ${tables}" th:text="${item.tableName+'-'+item.tableComment}"
                                        th:value="${item.tableName}"></option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">作者名称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="author" th:value="zhiqin" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">去表前缀</label>
                        <div class="layui-input-inline">
                            <input type="checkbox" name="isTablePrefix" checked lay-skin="switch">
                        </div>
                    </div>
                </div>
            </div>
        </fieldset>
        </form>
        <div class="panel layui-hide">
            <div class="panel-body panel-body-entity">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th width="100">字段名称</th>
                        <th width="100">字段注释</th>
                        <th width="100">数据类型</th>
                        <th width="100">列表显示</th>
                        <th width="100">查询方式</th>
                        <th width="100">字段验证</th>
                    </tr>
                    </thead>
                    <form class="layui-form" lay-filter="detailForm" id="detailForm">
                    <tbody id="entityTable">

                    </tbody>
                    </form>
                </table>
            </div>
        </div>
        <div class="panel layui-hide">
            <div class="panel-header">
                <div class="title">模板信息</div>
                <div class="info"><i></i>创建<i class="lose"></i>忽略</div>
            </div>
        </div>
        <div id="float" class="panel-body panel-body-float layui-hide">
            <div class="float-label active" data-name="entity"><span class="bindTableEntity">entity</span></div>
            <div class="float-label active" data-name="controller"><span class="bindTableEntity"></span>Controller</div>
            <div class="float-label active" data-name="service"><span class="bindTableEntity"></span>Service</div>
            <div class="float-label active" data-name="xxxReq"><span class="bindTableEntity"></span>XXXReq</div>
            <div class="float-label active" data-name="xxxCreateReq"><span class="bindTableEntity"></span>XXXCreateReq</div>
            <div class="float-label active" data-name="xxxUpdateReq"><span class="bindTableEntity"></span>XXXUpdateReq</div>
            <div class="float-label active" data-name="xxxDeleteReq"><span class="bindTableEntity"></span>XXXDeleteReq</div>
            <div class="float-label active" data-name="xxxDto"><span class="bindTableEntity"></span>XXXDto</div>
            <div class="float-label active" data-name="xxxResp"><span class="bindTableEntity"></span>XXXResp</div>
            <div class="float-label active" data-name="apiManager"><span class="bindTableEntity"></span>Manager</div>
            <div class="float-label active" data-name="apiManagerImpl"><span class="bindTableEntity"></span>ManagerImpl</div>
            <div class="float-label active" data-name="apiService"><span class="bindTableEntity"></span>Service</div>
            <div class="float-label active" data-name="xxxApiReq"><span class="bindTableEntity"></span>XXXApiReq</div>
            <div class="float-label active" data-name="xxxApiCreateReq"><span class="bindTableEntity"></span>XXXApiCreateReq</div>
            <div class="float-label active" data-name="xxxApiUpdateReq"><span class="bindTableEntity"></span>XXXApiUpdateReq</div>
            <div class="float-label active" data-name="xxxApiDeleteReq"><span class="bindTableEntity"></span>XXXApiDeleteReq</div>
            <div class="float-label active" data-name="xxxApiDto"><span class="bindTableEntity"></span>XXXApiDto</div>
            <div class="float-label active" data-name="xxxApiResp"><span class="bindTableEntity"></span>XXXApiResp</div>
            <div class="float-label active" data-name="mapper"><span class="bindTableEntity">mapper</span></div>
            <div class="float-label active" data-name="mapperXml"><span class="bindTableEntity">mapper.xml</span></div>
            <div class="float-label active" data-name="html"><span class="bindTableEntity">html</span></div>
            <div class="float-label active" data-name="i18n"><span class="bindTableEntity">i18n</span></div>
        </div>
    </div>
    <div class="layui-card-body layui-hide" >
        <div>
            <button type="submit" class="layui-btn layui-btn-normal layui-layout-right" lay-submit="submit"
                    lay-filter="submit">生成代码
            </button>
        </div>
    </div>
</div>
<div hidden id="verifyHtml">
    <select name="verify" multiple>
        <option value="">请选择</option>
        <option th:each="item,key:${fieldVerify}" th:value="${item.key}">[[${item.value}]]</option>
    </select>
</div>
<div hidden id="fieldHtml">
    <select name="query">
        <option value="">请选择</option>
        <option th:each="item,key:${fieldQuery}" th:value="${item.key}">[[${item.value}]]</option>
    </select>
</div>
<script type="text/javascript" th:src="@{/js/plugins/jquery-2.2.4.min.js}"></script>
<script th:src="@{/lib/layui-v2.3.0/layui.js}" charset="utf-8"></script>
<script th:src="@{/js/main.js}" charset="utf-8"></script>
<script type="text/javascript" th:src="@{/lib/zTree_v3/js/jquery.ztree.core.min.js}"></script>
<script type="text/javascript" th:src="@{/js/timoTree.js}"></script>
<script type="text/javascript" th:src="@{/js/generate.code.js}"></script>
<script type="text/javascript">
    // 树形菜单
    $.fn.selectTree({
        rootTree: '顶级菜单'
    });

    // 验证下拉选择器
    layui.config({
        base: '[[@{/lib/formSelects-v4/}]]'
    }).extend({
        formSelects: 'formSelects-v4.min'
    });

</script>
</body>
</html>